package cn.dyp.com.automaticcontrolclient.activity;


import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;
import android.view.WindowManager;

import cn.dyp.com.automaticcontrolclient.dialog.IpSetDialog;
import cn.dyp.com.automaticcontrolclient.fragment.SettingFragment;

/**
 * 程序启动后的Activity 负责显示设置ip的Dialog和启动Fragment
 * 在SystemSetting的基础上增加网络请求、联系设备的功能
 *
 * @author asus
 *
 */
public class MainActivity extends AppCompatActivity {
	private IpSetDialog mDialog;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		getSupportActionBar().hide();
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

		mDialog = new IpSetDialog(this);
		mDialog.show(getFragmentManager(), "dialog");//显示设置ip的Dialog

		getFragmentManager().beginTransaction()
				.replace(android.R.id.content, new SettingFragment()).commit();//启动Fragment
	}
}
